/*
 * @Author: 麦冬果果
 * @Date: 2021-09-03 16:55:56
 * @LastEditTime: 2021-09-11 11:28:31
 * @LastEditors: 麦冬果果
 * @Description: 文件描述
 * @FilePath: /web/Users/mac/Documents/mdgg/mgf-appdemo/web/src/utils/auth.js
 * 可以输入预定的版权声明、个性签名、空行等
 */
import Cookies from 'js-cookie'
import settings from '@/settings'
const TokenKey = 'mgf-Token'// Admin-Token

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  if (settings.cookiesDomain === '') {
    return Cookies.set(TokenKey, token)
  } else {
    return Cookies.set(TokenKey, token, { domain: settings.cookiesDomain })
  }
}

export function removeToken() {
  if (settings.cookiesDomain === '') {
    return Cookies.remove(TokenKey)
  } else {
    return Cookies.remove(TokenKey, { domain: settings.cookiesDomain })
  }
}
